package com.kata.chapter12;

import java.sql.Connection;

/**
 * Created by Solidsnake on 2014/12/4.
 */
public class AutoCloseTransaction extends Transaction {

    public AutoCloseTransaction(IConnection connection) {
        super(connection);
    }

    @Override
    protected void before() {
        System.out.println("事务开始, 不作任何事");
    }

    @Override
    protected void after() {
        System.out.println("事务结束, 关闭连接");
        this.connection.close();
    }
}
